/**
 * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
 *
 * <p>Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 *
 * <p>http://www.gnu.org/licenses/lgpl.html
 *
 * <p>Unless required by applicable law or agreed to in writing, software distributed under the
 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing permissions and
 * limitations under the License.
 */
package xyz.fivefaith.tool.common.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import xyz.fivefaith.tool.common.domain.base.IBaseEnum;

/**
 * 业务代码枚举
 *
 * @author Chill
 */
@Getter
@AllArgsConstructor
public enum ResultCode implements IBaseEnum {

    /** 操作成功 */
    SUCCESS(200, "操作成功"),

    /** 业务异常 */
    FAILURE(400, "业务异常"),

    /** 请求未授权 */
    UN_AUTHORIZED(401, "请求未授权"),

    /** 404 没找到请求 */
    NOT_FOUND(404, "404 没找到请求"),

    /** 消息不能读取 */
    MSG_NOT_READABLE(400, "消息不能读取"),

    /** 不支持当前请求方法 */
    METHOD_NOT_SUPPORTED(405, "不支持当前请求方法"),

    /** 状态冲突 */
    HTTP_CONFLICT(409, "状态冲突"),

    /** 不支持当前媒体类型 */
    MEDIA_TYPE_NOT_SUPPORTED(415, "不支持当前媒体类型"),

    /** 请求被拒绝 */
    REQ_REJECT(403, "请求被拒绝"),

    /** 服务器异常 */
    INTERNAL_SERVER_ERROR(500, "服务器异常"),

    /** 缺少必要的请求参数 */
    PARAM_MISS(400, "缺少必要的请求参数"),

    /** 请求参数类型错误 */
    PARAM_TYPE_ERROR(400, "请求参数类型错误"),

    /** 请求参数绑定错误 */
    PARAM_BIND_ERROR(400, "请求参数绑定错误"),

    /** 参数校验失败 */
    PARAM_VALID_ERROR(400, "参数校验失败"),

    /** 系统警告 */
    SYSTEM_WARN(601, "系统警告"),
    ;

    /** code编码 */
    final int code;

    /** 中文信息描述 */
    final String message;
}
